using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;
using YDExtendTool;
using YDExtendTool.Scripts;

public class InspectorViewData : SerializedScriptableObject
{

    [Title("树介绍")]
    [ShowInInspector, HideLabel,PropertyOrder(1)]
    [MultiLineProperty(5)]
    public string treeDescription
    {
        get
        {
            TreeNodeDataBase data = Resources.Load<TreeNodeDataBase>(TreeDataSetting.Instance.EditTreeDataPath);
            if (data != null)
            {
                return data.treeDescription;
            }

            return "";
        }
        set
        {
            TreeNodeDataBase data = Resources.Load<TreeNodeDataBase>(TreeDataSetting.Instance.EditTreeDataPath);
            if (data != null)
            {
                data.treeDescription = value;
            }
        }
    }


    [Title("节点介绍")]
    [ShowInInspector,HideLabel,PropertyOrder(2)]
    [MultiLineProperty]
    public string description
    {
        get
        {
            var it = Data.GetEnumerator();
            if (it.MoveNext())
            {
                if (it.Current != null)
                {
                    return it.Current.GetType()+":"+it.Current.Description;
                }
            }

            return "";
        }
    }
    
    [ShowInInspector,PropertyOrder(3)]
    public HashSet<TreeNodeBase> Data = new HashSet<TreeNodeBase>();

    public static InspectorViewData Instance => Resources.Load<InspectorViewData>("TreeData/InspectorViewData");
}
